package com.yx.shop.service;

import com.yx.shop.entitly.Cart;

import java.util.List;

/**
 * @Classname CartService
 * @Description TODO:
 * @Date 2021/05/07 23:10
 * @Created by yx
 */
public interface CartService {
    /**
     * @Author:yx
     * @return void
     * @Date 2021/05/09 14:54
     * @param uid
     * @param pid
     * @Description:根据uid与pid将商品添加至购物车中
     **/
    void createCart(Integer uid, Integer pid);

    /**
     * @Author:yx
     * @return java.util.List<com.yx.shop.entitly.Cart>
     * @Date 2021/05/09 14:54
     * @param uid
     * @Description:通过uid查询该用户的购物车
     **/
    List<Cart> getCartByUid(Integer uid);

    /**
     * @Author:yx
     * @return boolean
     * @Date 2021/05/09 14:53
     * @param pid
     * @param uid
     * @Description:根据pid的值进行不同功能,0--->清空购物车,否则删除该商品
     **/
    boolean clearCart(Integer pid, int uid);

    /**
     * @Author:yx
     * @return java.lang.Boolean
     * @Date 2021/05/09 14:52
     * @param uid
     * @param pid
     * @param num
     * @param pprice
     * @Description:更新购物车商品数量等信息
     **/
    Boolean updateCart(int uid, Integer pid, Integer num, Double pprice);
}
